package cn.dujc.superkid.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.RenderProcessGoneDetail;
import android.widget.TextView;

import java.util.List;

import cn.dujc.core.adapter.BaseAdapter;
import cn.dujc.core.adapter.BaseViewHolder;
import cn.dujc.superkid.R;
import cn.dujc.superkid.bean.MessageResult;
import cn.dujc.superkid.bean.MyExamineResult;
import cn.dujc.superkid.utils.DateUtil;

/**
 * Created by ASUS on 2018/8/12.
 */

public class MessageAdapter extends BaseAdapter<MessageResult> {

    public MessageAdapter(List<MessageResult> layoutResId) {
        super(layoutResId);
        mLayoutResId=R.layout.item_message;
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageResult item) {
        helper.setText(R.id.msg_time,DateUtil.formatData("yyyy-MM-dd HH:mm:ss",Long.parseLong(item.getSend_time())));
        helper.setText(R.id.msg_title,item.getSend_username());
        helper.setText(R.id.msg_content,item.getReceive_content());
        helper.getView(R.id.msg_state).setVisibility(View.GONE);
        if (item.getState()=="1"){//1是未读，会显示红点
            helper.setVisible(R.id.msg_state, true);
        }

    }
}
